<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Turtle DB: ca.uqac.dim.ddb.Engine Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Turtle DB
   
   </div>
   <div id="projectbrief">A mini DDBMS</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a>  </div>
  <div class="headertitle">
<div class="title">ca.uqac.dim.ddb.Engine Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="ca::uqac::dim::ddb::Engine" -->
<p><a href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#addf32a2f3fea36bf7ef6cbaeb928ef04">Engine</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#a6383f07b0259ad4302c529691c74e245">put</a> (String name, <a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_relation.html">Relation</a> r)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_table.html">Table</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#af936efd8a065b528a3f01a5d718d51b4">evaluate</a> (<a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_relation.html">Relation</a> query)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_table.html">Table</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#a32d2a6f0a1c4039640b89350e52c4e85">evaluate</a> (String s)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_table.html">Table</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#a706380e0e1e41e09a9376ab904457b9b">evaluate</a> (Document d)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#a42df1597f3224ecbe799d43fd7646c77">getStorageSize</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#a1ed5ff8262992b5d492f55ed9e8e6bb5">getTuplesReceived</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Map&lt; String, <a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_relation.html">Relation</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#a492bcaa5fd7034b32a7d3c562df210c8">m_tables</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#a0722f1a1d2e86bf7046cb182b983f3d0">m_tuplesReceived</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>An engine does two things: </p>
<ol>
<li>
It locally hosts relations (or fragments thereof) </li>
<li>
It receives relational query trees and evaluates them against the locally-hosted relations, then outputs the resulting relation </li>
</ol>
<dl class="author"><dt><b>Author:</b></dt><dd>sylvain </dd></dl>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="addf32a2f3fea36bf7ef6cbaeb928ef04"></a><!-- doxytag: member="ca::uqac::dim::ddb::Engine::Engine" ref="addf32a2f3fea36bf7ef6cbaeb928ef04" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#addf32a2f3fea36bf7ef6cbaeb928ef04">ca.uqac.dim.ddb.Engine.Engine</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Instantiates a new database query engine. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="af936efd8a065b528a3f01a5d718d51b4"></a><!-- doxytag: member="ca::uqac::dim::ddb::Engine::evaluate" ref="af936efd8a065b528a3f01a5d718d51b4" args="(Relation query)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_table.html">Table</a> <a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#af936efd8a065b528a3f01a5d718d51b4">ca.uqac.dim.ddb.Engine.evaluate</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_relation.html">Relation</a>&#160;</td>
          <td class="paramname"><em>query</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Locally evaluates a query </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">query</td><td>The query XML document </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A new table containing the results of that query </dd></dl>

</div>
</div>
<a class="anchor" id="a32d2a6f0a1c4039640b89350e52c4e85"></a><!-- doxytag: member="ca::uqac::dim::ddb::Engine::evaluate" ref="a32d2a6f0a1c4039640b89350e52c4e85" args="(String s)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_table.html">Table</a> <a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#af936efd8a065b528a3f01a5d718d51b4">ca.uqac.dim.ddb.Engine.evaluate</a> </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>s</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Locally evaluates a query </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>The query string </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A new table containing the results of that query </dd></dl>

</div>
</div>
<a class="anchor" id="a706380e0e1e41e09a9376ab904457b9b"></a><!-- doxytag: member="ca::uqac::dim::ddb::Engine::evaluate" ref="a706380e0e1e41e09a9376ab904457b9b" args="(Document d)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_table.html">Table</a> <a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#af936efd8a065b528a3f01a5d718d51b4">ca.uqac.dim.ddb.Engine.evaluate</a> </td>
          <td>(</td>
          <td class="paramtype">Document&#160;</td>
          <td class="paramname"><em>d</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a42df1597f3224ecbe799d43fd7646c77"></a><!-- doxytag: member="ca::uqac::dim::ddb::Engine::getStorageSize" ref="a42df1597f3224ecbe799d43fd7646c77" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#a42df1597f3224ecbe799d43fd7646c77">ca.uqac.dim.ddb.Engine.getStorageSize</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the total number of tuples hosted locally by this database engine. This can be used, in conjunction with <a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#a1ed5ff8262992b5d492f55ed9e8e6bb5">getTuplesReceived</a>, to compute cost metrics. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of tuples </dd></dl>

</div>
</div>
<a class="anchor" id="a1ed5ff8262992b5d492f55ed9e8e6bb5"></a><!-- doxytag: member="ca::uqac::dim::ddb::Engine::getTuplesReceived" ref="a1ed5ff8262992b5d492f55ed9e8e6bb5" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#a1ed5ff8262992b5d492f55ed9e8e6bb5">ca.uqac.dim.ddb.Engine.getTuplesReceived</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the number of tuples this engine received from the outside world. This can be used, in conjunction with <a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#a42df1597f3224ecbe799d43fd7646c77">getStorageSize</a>, to compute cost metrics. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of tuples </dd></dl>

</div>
</div>
<a class="anchor" id="a6383f07b0259ad4302c529691c74e245"></a><!-- doxytag: member="ca::uqac::dim::ddb::Engine::put" ref="a6383f07b0259ad4302c529691c74e245" args="(String name, Relation r)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#a6383f07b0259ad4302c529691c74e245">ca.uqac.dim.ddb.Engine.put</a> </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_relation.html">Relation</a>&#160;</td>
          <td class="paramname"><em>r</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Stores a new relation within the engine. Normally one would only store instances of <a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_table.html">Table</a> here (although any relation can be passed). </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>The relation's name </td></tr>
    <tr><td class="paramname">r</td><td>The relation </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a492bcaa5fd7034b32a7d3c562df210c8"></a><!-- doxytag: member="ca::uqac::dim::ddb::Engine::m_tables" ref="a492bcaa5fd7034b32a7d3c562df210c8" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Map&lt;String,<a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_relation.html">Relation</a>&gt; <a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#a492bcaa5fd7034b32a7d3c562df210c8">ca.uqac.dim.ddb.Engine.m_tables</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a0722f1a1d2e86bf7046cb182b983f3d0"></a><!-- doxytag: member="ca::uqac::dim::ddb::Engine::m_tuplesReceived" ref="a0722f1a1d2e86bf7046cb182b983f3d0" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html#a0722f1a1d2e86bf7046cb182b983f3d0">ca.uqac.dim.ddb.Engine.m_tuplesReceived</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>Engin/src/ca/uqac/dim/ddb/<a class="el" href="_engine_8java.html">Engine.java</a></li>
</ul>
</div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceca.html">ca</a>      </li>
      <li class="navelem"><a class="el" href="namespaceca_1_1uqac.html">uqac</a>      </li>
      <li class="navelem"><a class="el" href="namespaceca_1_1uqac_1_1dim.html">dim</a>      </li>
      <li class="navelem"><a class="el" href="namespaceca_1_1uqac_1_1dim_1_1ddb.html">ddb</a>      </li>
      <li class="navelem"><a class="el" href="classca_1_1uqac_1_1dim_1_1ddb_1_1_engine.html">Engine</a>      </li>

    <li class="footer">Generated on Thu Aug 30 2012 12:03:09 for Turtle DB by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
